package com.zg.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.zg.pojo.TagToGoods;
import com.zg.service.TagToGoodsService;

@Controller
public class TagToGoodsController {
	
	@Resource
	private TagToGoodsService tagToGoodsService;
	
	public boolean addTagToGoods(int goodsId, int tagId) {
		TagToGoods tagToGoods = new TagToGoods();
		tagToGoods.setGoodsid(goodsId);
		tagToGoods.setTagid(tagId);
		
		this.tagToGoodsService.insert(tagToGoods);
		return true;
	}
	
	public boolean deleteTagByGoodId(int goodsId, int tagId){
		this.tagToGoodsService.deleteTagToGoodsByTagAndGoods(goodsId, tagId);
		return true;
	}
	
}
